-- GENERATED SPELL FOR [Deathshadow Spellbinder] --


function spell0_22342(pUnit, Event) --@Arcane Missiles,n/a--
pUnit:FullCastSpellOnTarget(34447,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22342', 578, 1)
end

function spell1_22342(pUnit, Event) --@Chains of Ice,n/a--
pUnit:FullCastSpellOnTarget(22744,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22342', 11000, 1)
end

function spell2_22342(pUnit, Event) --@Counterspell,n/a--
pUnit:FullCastSpellOnTarget(31999,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22342', 17000, 1)
end

function Sorts_22342(pUnit, Event)
local choix_sorts_22342 = math.random(0, 2)
if choix_sorts_22342 == 0 then
pUnit:RegisterEvent('spell0_22342', 1, 1)
end
if choix_sorts_22342 == 1 then
pUnit:RegisterEvent('spell1_22342', 1, 1)
end
if choix_sorts_22342 == 2 then
pUnit:RegisterEvent('spell2_22342', 1, 1)
end
end

function mob22342_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22342', math.random(1500, 3000), 1)
end

function mob22342_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22342_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22342_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22342, 1, 'mob22342_Action')
RegisterUnitEvent(22342, 2, 'mob22342_Leave')
RegisterUnitEvent(22342, 3, 'mob22342_Kill')
RegisterUnitEvent(22342, 4, 'mob22342_Die')
